﻿<UserControl x:Class="AllGamesModule.Views.AllGamesView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:Metro="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
             mc:Ignorable="d" 
             d:DesignHeight="340" d:DesignWidth="270">
    
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <!--TabControl样式定义-->
                <ResourceDictionary Source="pack://application:,,,/Resources;component/Styles/TabControlStyle.xaml"/>
                <!--ListBox样式定义-->
                <ResourceDictionary Source="pack://application:,,,/Resources;component/Styles/ListBoxStyle.xaml"/>
                <!--总文字定义-->
                <ResourceDictionary Source="pack://application:,,,/Resources;component/Styles/Themes/Texts.xaml"/>
            </ResourceDictionary.MergedDictionaries>

            <XmlDataProvider x:Key="xmlHot" Source="pack://application:,,,/Games;component/XmlFile/ClassifyGamesFile.xml" XPath="Data/GameType/Hot"/>
            <XmlDataProvider x:Key="xmlCAC" Source="pack://application:,,,/Games;component/XmlFile/ClassifyGamesFile.xml" XPath="Data/GameType/ChessAndCard"/>
            <XmlDataProvider x:Key="xmlImm" Source="pack://application:,,,/Games;component/XmlFile/ClassifyGamesFile.xml" XPath="Data/GameType/Immediate"/>
            <XmlDataProvider x:Key="xmlOth" Source="pack://application:,,,/Games;component/XmlFile/ClassifyGamesFile.xml" XPath="Data/GameType/Other"/>
        </ResourceDictionary>
    </UserControl.Resources>

    <Border BorderBrush="{StaticResource border}" BorderThickness="1" CornerRadius="3" Background="{StaticResource bg_module}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="25"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <!--标题栏-->
            <Grid Grid.Row="0" Background="{StaticResource tilebtn_bg}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="30"/>
                    <ColumnDefinition Width="1"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Path Grid.Column="0" Height="14" Width="15" Stretch="Fill" Fill="{StaticResource arrow}" Data="F1 M 19,19L 36,19L 36,36L 19,36L 19,19 Z M 19,40L 36,40L 36,57L 19,57L 19,40 Z M 40,57L 40,40L 57,40L 57,57L 40,57 Z M 40,36L 40,19L 57,19L 57,36L 40,36 Z "/>
                <TextBlock Grid.Column="2" Text="游戏分类" VerticalAlignment="Center" Foreground="{StaticResource bg_text}"/>
            </Grid>
            <TabControl Grid.Row="1" Style="{StaticResource tabControl}">
                <Metro:MetroTabItem Header="{StaticResource type_hot}" HeaderFontSize="16" Style="{StaticResource metroTabItem}">
                    <ListBox ItemContainerStyle="{StaticResource allGameListStyle}" Style="{StaticResource gametemplate}" 
                         DataContext="{Binding Source={StaticResource xmlHot}}" ItemsSource="{Binding}" Background="{x:Null}" BorderThickness="0"/>
                </Metro:MetroTabItem>
                <Metro:MetroTabItem Header="{StaticResource type_chessandcard}" HeaderFontSize="16" Style="{StaticResource metroTabItem}">
                    <ListBox ItemContainerStyle="{StaticResource allGameListStyle}" Style="{StaticResource gametemplate}"
                         DataContext="{Binding Source={StaticResource xmlCAC}}" ItemsSource="{Binding}" Background="{x:Null}" BorderThickness="0"/>
                </Metro:MetroTabItem>
                <Metro:MetroTabItem Header="{StaticResource type_immediate}" HeaderFontSize="16" Style="{StaticResource metroTabItem}">
                    <ListBox ItemContainerStyle="{StaticResource allGameListStyle}" Style="{StaticResource gametemplate}"
                         DataContext="{Binding Source={StaticResource xmlImm}}" ItemsSource="{Binding}" Background="{x:Null}" BorderThickness="0"/>
                </Metro:MetroTabItem>
                <Metro:MetroTabItem Header="{StaticResource type_other}" HeaderFontSize="16" Style="{StaticResource metroTabItem}">
                    <ListBox ItemContainerStyle="{StaticResource allGameListStyle}" Style="{StaticResource gametemplate}"
                         DataContext="{Binding Source={StaticResource xmlOth}}" ItemsSource="{Binding}" Background="{x:Null}" BorderThickness="0"/>
                </Metro:MetroTabItem>
            </TabControl>
        </Grid>
    </Border>
</UserControl>
